﻿<%@ Page Title="" Language="C#" MasterPageFile="~/TP3Master.master" AutoEventWireup="true"
    CodeFile="frmRegPedidoCancion.aspx.cs" Inherits="Karaoke_Gestion_frmRegPedidoCancion" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">

<script type ="text/javascript" language="javascript">
    var _source;

    var _popup;

    function showConfirm(source) {
        this._source = source;
        this._popup = $find('mdlPopup');

        this._popup.show();
    }

    function okClick() {
        //  find the confirm ModalPopup and hide it    
        this._popup.hide();
        //  use the cached button as the postback source
        __doPostBack(this._source.name, '');
    }

    function cancelClick() {
        //  find the confirm ModalPopup and hide it 
        this._popup.hide();
        //  clear the event source
        this._source = null;
        this._popup = null;
    }

    function cerrar() {

        document.getElementById('escritorio1').style.display = 'none';
        window.f_escritorio1.location.replace('');

    }

    function TestMensaje(valor) {

        document.getElementById('escritorio1').style.display = 'none';
        window.f_escritorio1.location.replace('');
        __doPostBack('prueba', '');

    }

</script>

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div style="height: 500px">

     <table width="60%" align="center"  cellpadding="4" cellspacing="1">
     <tr>
            <td align="left" class="filaCab">
                <asp:Label ID="Label1" runat="server" Text="Registro de Pedido de Canción" Font-Size="Larger"></asp:Label>
            </td>
        </tr>
     </table>

     <table width="60%" align="center"  cellpadding="4" cellspacing="1">
             <tr>
                <td align="right" style="width: 30%;">
                    <asp:Label ID="lblDatosUsuaio" runat="server"  Font-Size="X-Small" ForeColor="Green" Text="Bienvenido Cantante"></asp:Label>
                </td>
            </tr>
     </table>
          <BR />
     <table width="60%" align="center"  cellpadding="4" cellspacing="1">
             <tr>
                <td align="left" style="width: 30%;">
                    <asp:Label ID="lblMesaBox" runat="server" ForeColor="Green"></asp:Label>
                </td>
            </tr>
     </table>
     <div>
     <asp:Panel ID="pnlMantenimiento" runat="server" Visible="False">
     <table width="60%" align="center"  cellpadding="4" cellspacing="1">
                    <tr>
                        <td align="left">
                            <asp:Button ID="btnConsultarCancion" runat="server" 
                                PostBackUrl="~/Karaoke/Gestion/frmConsultaCancionero.aspx?pag=frmRegPedidoCancion.aspx" 
                                Text="Consultar canción" />
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <asp:Label ID="lblSugerencia" runat="server" ForeColor="Green" 
                                Text="Por favor de consultar las canciones de su preferencia"></asp:Label>
                            <asp:GridView ID="gvListadoPedido" 
                                          runat="server" 
                                          AllowPaging="True" 
                                          AllowSorting="true" 
                                          AlternatingRowStyle-CssClass="altrowstyle" 
                                          AutoGenerateColumns="False" 
                                          BorderColor="Green" 
                                          BorderStyle="Inset" 
                                          CellPadding="3" CellSpacing="1" 
                                          DataKeyNames="CODIGO" Font-Names="Arial" 
                                          Font-Size="XX-Small" GridLines="None" 
                                          OnPageIndexChanging="Nombre_GridView_PageIndexChanging" 
                                          OnRowDataBound="gvListadoPedido_RowDataBound" 
                                          PagerSettings-PageButtonCount="10" 
                                          PageSize="5" 
                                          Width="100%" onrowcommand="gvListadoPedido_RowCommand">
                                <SelectedRowStyle BorderStyle="Solid" Font-Bold="True" />
                                <HeaderStyle Font-Bold="True" />
                                <AlternatingRowStyle BackColor="White" />
                                <Columns>
                                    <asp:BoundField HeaderText="ORDEN" />
                                    <asp:BoundField DataField="titulo" HeaderText="CANCIÓN" />
                                    <asp:BoundField DataField="cantante" HeaderText="CANTANTE" />
                                    <asp:BoundField DataField="categoria" HeaderText="GENERO" />
                                    <asp:BoundField HeaderText="ESTADO" />
                                    <asp:BoundField DataField="idCancion" HeaderText="CODIGO" Visible="false" />
                                    <asp:TemplateField HeaderText="ACTUALIZAR">
                                        <ItemStyle HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:ImageButton ID="btnActualizar" runat="server" CausesValidation="False" 
                                                Height="24px" ImageUrl="~/Images/botones/page_edit.gif" 
                                                OnClick="btnActualizar_Click" Text="Actualizar" ToolTip="Actualizar" 
                                                Width="24px" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="ELIMINAR">
                                        <ItemStyle HorizontalAlign="Center" />
                                        <ItemTemplate>
                                                <asp:ImageButton ID="btnEliminar" 
                                                                 runat="server" 
                                                                 ImageUrl="~/Images/botones/delete.gif" 
                                                                 CommandName="borrar" 
                                                                 OnClientClick="showConfirm(this); return false;"  
                                                                 CommandArgument ="<%# ((GridViewRow) Container).RowIndex %>" />

                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <PagerTemplate>
                                    &nbsp; &nbsp; Pagina: <%=gvListadoPedido.PageIndex + 1%>de <%=gvListadoPedido.PageCount%>&nbsp;
                                    <asp:Button ID="Button4" runat="server" CommandArgument="First" 
                                        CommandName="Page" CssClass="pagfirst" ToolTip="Prim. Pag" 
                                        Visible="<%# gvListadoPedido.PageIndex > 0%>" />
                                    <asp:Button ID="Button1" runat="server" CommandArgument="Prev" 
                                        CommandName="Page" CssClass="pagprev" ToolTip="Pág. anterior" 
                                        Visible="<%# gvListadoPedido.PageIndex > 0%>" />
                                    <asp:Button ID="Button2" runat="server" CommandArgument="Next" 
                                        CommandName="Page" CssClass="pagnext" ToolTip="Sig. página" 
                                        Visible="<%# Convert.ToBoolean(gvListadoPedido.PageIndex + 1 - gvListadoPedido.PageCount) %>" />
                                    <asp:Button ID="Button3" runat="server" CommandArgument="Last" 
                                        CommandName="Page" CssClass="paglast" ToolTip="Últ. Pag" 
                                        Visible="<%# Convert.ToBoolean(gvListadoPedido.PageIndex + 1 - gvListadoPedido.PageCount) %>" />
                                </PagerTemplate>
                                <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                                <SortedAscendingCellStyle BackColor="#FDF5AC" />
                                <SortedAscendingHeaderStyle BackColor="#4D0000" />
                                <SortedDescendingCellStyle BackColor="#FCF6C0" />
                                <SortedDescendingHeaderStyle BackColor="#820000" />
                            </asp:GridView>
                        </td>
                    </tr>
        </table>
     </asp:Panel>
     </div>
         <cc1:ModalPopupExtender ID="modalP"
    BehaviorID="mdlPopup" runat="server" 
    TargetControlID="div" PopupControlID="div" 
    OkControlID="btnOk" OnOkScript="okClick();" 
    CancelControlID="btnNo" OnCancelScript="cancelClick();" BackgroundCssClass="modalBackground" > </cc1:ModalPopupExtender>
        
      <div id="div" runat="server" align="center" class="confirm" style="display :none " >
                <table >
                <tr align="center">
                   <td style="height: 9px; width: 227px;">
                       Está seguro de eliminar la canción de la lista?
                   </td>
                </tr>
                </table>
                <table><tr  align ="center">
                    <td style="width: 49px">
                     <asp:Button ID="btnOk" runat="server" Text="SI" Width="50px" /></td>
                    <td> <asp:Button ID="btnNo" runat="server" Text="NO" Width="50px" /></td></tr>
                </table>
    
      </div>
        
    </div>
</asp:Content>
